package com.example.testproj.design.abstract_factory;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.example.testproj.R;

public class AbstractFactoryTestActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_abstract_factory_test);

        User user = new User();
        Department department = new Department();
        IFactory factory = new AccessFactory();

        IUser iUser = factory.createUser();
        iUser.insert(user);
        iUser.getUser(1);

        IDepartment iDepartment = factory.cretaeDepartment();
        iDepartment.insert(department);
        iDepartment.getDepartment(1);
    }
}
